package com.haotunet.app.goldtreasure.net;

import android.content.Context;

import com.haotunet.app.goldtreasure.model.ExtractGold;

import java.util.HashMap;
import java.util.List;


public class DataUtil {
    private NetUtil mNetUtil;
    private static DataUtil mDataUtil;

    public static DataUtil getInstance(Context context) {
        if (null == mDataUtil) {
            mDataUtil = new DataUtil(context);
        }
        return mDataUtil;
    }

    private DataUtil(Context context) {
        mNetUtil = new NetUtil(context);
    }

    public String getCurrentGoldPrice() {
        String url = UrlUtil.GET_CURRENT_GOLD_PRICE;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getManageGoldTotalQuantity() {
        String url = UrlUtil.GET_MANAGE_GOLD_TOTAL_QUANTITY;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getBuyGoldDetail(String productId) {
        String url = UrlUtil.GET_BUY_GOLD_DETAIL;
        HashMap<String, Object> map = new HashMap<>();
        map.put(Json.PRODUCTID, productId);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String getBanner(int type) {
        String url = null;
        HashMap<String, Object> map = new HashMap<>();
        if (type == 1) {
            url = UrlUtil.GET_BANNER;
            map.put(Json.SOURCE, "android");
        } else {
            url = UrlUtil.GET_FOUND_BANNER;
        }
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String getRecommendProduct() {
        String url = UrlUtil.GET_RECOMMEND_PRODUCT;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String searchOrderState(String orderNo, String payGate, String subGate) {
        String url = UrlUtil.SEARCH_ORDER_STATE;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.ORDERPAYORDERSN, orderNo);
        map.put(Json.ORDERPAYGATE, payGate);
        map.put(Json.ORDERSUBGATE, subGate);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String CheckLoginInfo(String blackBox, String username, String password, String clientId, String imei) {
        String url = UrlUtil.USER_LOGIN;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.USERNAME, username);
        map.put(Json.PASSWORD, password);
        map.put(Json.CLIENTID, clientId);
        map.put(Json.SOURCE, "android");
        map.put(Json.IMEI, imei);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getRegisterCode(String phoneNum, String blackBox, String imei) {
        String url = UrlUtil.GET_REGISTER_VERICODE;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.PHONE, phoneNum);
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.IMEI, imei);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String logOut() {
        String url = UrlUtil.APP_LOGOUT;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String submitRegisterinfo(String channelId, String blackBox, String phone, String vericode, String password,
                                     String recommendNum, String imei, String cliendId) {
        String url = UrlUtil.USER_REGISTER;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.CHANNELID, channelId);
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.USERNAME, phone);
        map.put(Json.PASSWORD, password);
        map.put(Json.CODE, vericode);
        map.put(Json.SOURCE, "android");
        map.put(Json.INVITECODE, recommendNum);
        map.put(Json.IMEI, imei);
        map.put(Json.CLIENTID, cliendId);
        String jsonStr = mNetUtil.getRedirectInfo(url, map);
        return jsonStr;
    }

    public String getFindPwdCode(String phoneNum, String blackBox, String imei, int type) {
        HashMap<String, Object> map = new HashMap<String, Object>();
        String url = null;
        String jsonStr = null;
        if (type == 1) {
            url = UrlUtil.GET_FINDPWD_VERICODE;
            map.put(Json.PHONE, phoneNum);
        } else {
            url = UrlUtil.GET_CHANGE_TRADING_PWD_VERICODE;
        }
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.IMEI, imei);
        jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String getWeChatCode(String phoneNum, String blackBox, String imei) {
        HashMap<String, Object> map = new HashMap<String, Object>();
        String url = UrlUtil.GET_WECHAT_VERICODE;
        map.put(Json.PHONE, phoneNum);
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.IMEI, imei);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String checkVeriCode(String phoneNum, String vericode) {
        String url = UrlUtil.CHECK_VERICODE;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.PHONE, phoneNum);
        map.put(Json.VERIFYCODE, vericode);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String resetNewPwd(String blackBox, int type, String phone, String code, String oldPwd, String newPwd, String imei,
                              String clientId) {
        String url = null;
        String jsonStr = null;
        if (type == 1) {
            url = UrlUtil.RESET_PWD;
        } else if (type == 2) {
            url = UrlUtil.CHANGE_LOGIN_PWD;
        } else if (type == 3 || type == 4 || type == 6) {
            url = UrlUtil.RESET_TRADING_PWD;
        } else {
            url = UrlUtil.SET_TRADING_PWD;
        }
        HashMap<String, String> map = new HashMap<String, String>();
        if (type == 1) {
            map.put(Json.PHONE, phone);
            map.put(Json.CODE, code);
            map.put(Json.NEWPASSWORD, newPwd);
            map.put(Json.MODIFYPASSWORDTYPE, "FORGET_WITH_MODIFY_PASSWORD");
            map.put(Json.BLACKBOX, blackBox);
            map.put(Json.SOURCE, "android");
            map.put(Json.IMEI, imei);
            map.put(Json.CLIENTID, clientId);
            jsonStr = mNetUtil.getRedirectInfo(url, map);
        } else if (type == 2) {
            map.put(Json.OLDPASSWORD, oldPwd);
            map.put(Json.NEWPASSWORD, newPwd);
            map.put(Json.MODIFYPASSWORDTYPE, "MODIFY_PASSWORD");
            jsonStr = mNetUtil.executePut(url, map);
        } else if (type == 3) {
            map.put(Json.OLDTRADINGPASSWORD, oldPwd);
            map.put(Json.NEWTRADINGPASSWORD, newPwd);
            map.put(Json.MODIFYPASSWORDTYPE, "MODIFY_PASSWORD");
            jsonStr = mNetUtil.executePut(url, map);
        } else if (type == 4 || type == 6) {
            map.put(Json.CODE, code);
            map.put(Json.NEWTRADINGPASSWORD, newPwd);
            map.put(Json.MODIFYPASSWORDTYPE, "FORGET_WITH_MODIFY_PASSWORD");
            jsonStr = mNetUtil.executePut(url, map);
        } else {
            map.put(Json.TRADINGPASSWORD, newPwd);
            jsonStr = mNetUtil.executePost(url, map);
        }
        return jsonStr;
    }

    public String getHomePageInfo() {
        String url = UrlUtil.GET_HOMEPAGE_INFO;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getSellPageInfo() {
        String url = UrlUtil.GET_SELLPAGE_INFO;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getProductInfo() {
        String url = UrlUtil.GET_PRODUCT_INFO;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getGoldCoinInfo(String pageNum) {
        String url = UrlUtil.GET_GOLD_COIN_INFO;
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String getRedPacketDetail(String pageNum) {
        String url = UrlUtil.GET_RED_PACKET_DETAIL;
        HashMap<String, String> map = new HashMap<>();
        map.put(Json.OFFSET, pageNum);
        map.put(Json.COUNT, "20");
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getSellGoldRecord(String pageNum) {
        String url = UrlUtil.GET_SELL_GOLD_RECORD;
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    private String getRecordDataStr(String pageNum, String url) {
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.OFFSET, pageNum);
        map.put(Json.COUNT, 20);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String getDepositGoldRecord(String pageNum) {
        String url = UrlUtil.GET_DEPOSIT_GOLD_RECORD;
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String getExtractGoldRecord(String pageNum) {
        String url = UrlUtil.GET_EXTRACT_GOLD_RECORD;
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String getExchangeGoldRecord(String pageNum) {
        String url = UrlUtil.GET_EXCHANGE_GOLD_RECORD;
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String getExchangePageInfo() {
        String url = UrlUtil.GET_EXCHANGE_PAGE_INFO;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getMyTotalGold() {
        String url = UrlUtil.GET_MY_TOTAL_GOLD;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String sellGoldOperation(String goldPrice, String goldGram) {
        String url = UrlUtil.SELL_GOLD_OPERATION;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.GOLDPRICE, goldPrice);
        map.put(Json.GOLDGRAMS, goldGram);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String submitSellGoldData(String blackBox, String orderNo, String payPassword) {
        String url = UrlUtil.SUBMIT_SELL_GOLD_DATA;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.ORDERNO, orderNo);
        map.put(Json.TRADINGPASSWORD, payPassword);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }


    public String getMyRegularBuyRecord(int type, String pageNum) {
        String url = null;
        if (type == 1) {
            url = UrlUtil.GET_MY_CURRENT_BUY_RECORD;
        } else if (type == 2) {
            url = UrlUtil.GET_MY_REGULAR_BUY_RECORD;
        } else if (type == 3) {
            url = UrlUtil.GET_MY_G20_BUY_RECORD;
        }
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String getMyCoupons(int type, String pageNum) {
        String url = null;
        if (type == 1) {
            url = UrlUtil.GET_COUPONS;
        } else if (type == 2) {
            url = UrlUtil.GET_HISTORY_COUPONS;
        }
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String getMyCurrentGoldInfo(String productId) {
        String url = UrlUtil.GET_MY_CURRENT_GOLD;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.PRODUCTID, productId);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String currentToRegular(String goldGrams, String regularId, String tradePwd) {
        String url = UrlUtil.CURRENT_TO_REGULAR;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.PRODUCTID, regularId);
        map.put(Json.GOLDGRAMS, goldGrams);
        map.put(Json.TRADINGPASSWORD, tradePwd);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getAllShopPositionInfo(int type) {
        String url = UrlUtil.GET_ALL_SHOP_POSITION_INFO;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.OPERATIONTYPE, type);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String submitDepositGoldReseverInfo(String shopId, String bookTime) {
        String url = UrlUtil.GET_DEPOSIT_RESEVER_ORDER_INFO;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.SHOPID, shopId);
        map.put(Json.RESERVETIME, bookTime);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String submitExtractGoldReseverInfo(String shopId, String takeTime, String is_bill, String goldType,
                                               List<ExtractGold> gramList) {
        String url = UrlUtil.GET_EXTRACT_RESEVER_ORDER_INFO;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.SHOPID, shopId);
        map.put(Json.RESERVETIME, takeTime);
        map.put(Json.NEEDBILL, is_bill);
        map.put(Json.GOLDTYPE, goldType);
        for (int i = 0; i < gramList.size(); i++) {
            map.put("gramList[" + i + "].id", gramList.get(i).getId() + "");
            map.put("gramList[" + i + "].count", gramList.get(i).getCount() + "");
        }
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String submitExchangeGoldReseverInfo(String quantity, String shopId) {
        String url = UrlUtil.GET_EXCHANGE_RESEVER_ORDER_INFO;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.SHOPID, shopId);
        map.put(Json.QUANTITY, quantity);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getExtractGoldType() {
        String url = UrlUtil.GET_EXTRACT_GOLD_TYPE;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getBankCradList() {
        String url = UrlUtil.GET_BANKCARD_LIST;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getTips(int type) {
        String url = null;
        if (type == 1) {
            url = UrlUtil.GET_RECHARGE_TIPS;
        } else {
            url = UrlUtil.GET_WITHDRAW_TIPS;
        }
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String submitRechargeOrder(String payment) {
        String url = UrlUtil.SUBMIT_RECHARGE_ORDER;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.PAYMENT, payment);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String deleteBindCard(String card_no) {
        String url = UrlUtil.DELETE_BANKCARD;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.CARDNO, card_no);
        String jsonStr = mNetUtil.executeDelete(url, map);
        return jsonStr;
    }

    public String getVaultPageInfo() {
        String url = UrlUtil.GET_VAULT_PAGE_INFO;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getWalletPageInfo() {
        String url = UrlUtil.GET_WALLET_PAGE_INFO;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getWalletDetail(String pageNum) {
        String url = UrlUtil.GET_WALLET_DETAIL;
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String getPersonalPageInfo() {
        String url = UrlUtil.GET_PERSONAL_PAGE_INFO;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String everyday_sign() {
        String url = UrlUtil.EVERYDAY_SIGN;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getMyProfit() {
        String url = UrlUtil.CURRENT_ALL_PROFIT;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getWithdrawRecordList(String pageNum) {
        String url = UrlUtil.GET_WITHDRAW_RECORD;
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String submitFeedback(String content) {
        String url = UrlUtil.SUBMIT_FEEDBACK;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.CONTENT, content);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String confirmChoose(String regularId, String goldGrams, String orderPrice, String purchaseType) {
        String url = UrlUtil.CONFIRM_CHOOSE;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.PRODUCTID, regularId);
        map.put(Json.QUANTITY, goldGrams);
        map.put(Json.ORDERPRICE, orderPrice);
        map.put(Json.PURCHASETYPE, purchaseType);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String makeOrderOperation(String quantity, String unitPrice, String totalPrice, String couponIds,
                                     String couponValue, String isUseRedPacket, String productId, String purchaseType, String imei, String blackBox) {
        String url = UrlUtil.MAKE_ORDER_OPERATION;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.QUANTITY, quantity);
        map.put(Json.UNITPRICE, unitPrice);
        map.put(Json.TOTALPRICE, totalPrice);
        map.put(Json.COUPONIDS, couponIds);
        map.put(Json.USEREDPACKET, isUseRedPacket);
        map.put(Json.PRODUCTID, productId);
        map.put(Json.COUPONVALUE, couponValue);
        map.put(Json.PURCHASETYPE, purchaseType);
        map.put(Json.IMEI, imei);
        map.put(Json.BLACKBOX, blackBox);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getPayCode(String orderNo, String realName, String cardNo, String idNo, String mobile,
                             String orderAmount, String payGate, String subGate) {
        String url = UrlUtil.GET_PAY_CODE;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.PACSITEORDERSN, orderNo);
        map.put(Json.PACCARDACCOUNTNAME, realName);
        map.put(Json.PACCARDNO, cardNo);
        map.put(Json.PACCERTIFICATENO, idNo);
        map.put(Json.PACMOBILEPHONE, mobile);
        map.put(Json.PACORDERAMOUNT, orderAmount);
        map.put(Json.PACPAYGATE, payGate);
        map.put(Json.PACSUBGATE, subGate);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String submitPayInfo(String cardNo, String orderNo, String code, String payGate, String subGate) {
        String url = UrlUtil.PAY_OPERATION;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.PAYPARAMCARDNO, cardNo);
        map.put(Json.PAYPARAMSITEORDERSN, orderNo);
        map.put(Json.PAYPARAMCERTCODE, code);
        map.put(Json.PAYPARAMPAYGATE, payGate);
        map.put(Json.PAYPARAMSUBGATE, subGate);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getRegularProfitList(int type, String pageNum) {
        String url = null;
        if (type == 1) {
            url = UrlUtil.GET_REGULAR_UNDUE_PRODUCT;
        } else if (type == 2) {
            url = UrlUtil.GET_REGULAR_DUE_PRODUCT;
        }
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String setTradingPwd(String pwd) {
        String url = UrlUtil.SET_TRADING_PWD;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.TRADINGPASSWORD, pwd);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getStoreList(int pageNum, double lon, double lat, String address, int type) {
        String url = UrlUtil.GET_STORE_LIST;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.LON, lon);
        map.put(Json.LAT, lat);
        map.put(Json.OFFSET, pageNum);
        map.put(Json.COUNT, 20);
        map.put(Json.ADDRESS, address);
        if (type == 1) {
            map.put(Json.SHOPREQUESTTYPE, "IS_PAGING");
        } else {
            map.put(Json.SHOPREQUESTTYPE, "IS_NOT_PAGING");
        }
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String getStoreDetailInfo(String shopId) {
        String url = UrlUtil.GET_STORE_DETAIL_INFO;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.SHOPID, shopId);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String getVaultDetailInfo(String pageNum) {
        String url = UrlUtil.GET_VAULT_DETAIL_INFO;
        String jsonStr = getRecordDataStr(pageNum, url);
        return jsonStr;
    }

    public String verifyWithdrawFee(String money) {
        String url = UrlUtil.VERIFY_WITHDRAW_FEE;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.MONEY, money);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String submitWithdrawsApply(String cardNum, String amount, String payPassword, String address) {
        String url = UrlUtil.SUBMIT_WITHDRAWS_APPLY;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.CARDNO, cardNum);
        map.put(Json.TRADINGPASSWORD, payPassword);
        map.put(Json.MONEY, amount);
        map.put(Json.ADDRESS, address);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String submitAuthInfo(String realname, String idcard) {
        String url = UrlUtil.SUBMIT_AUTH_INFO;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.REALNAME, realname);
        map.put(Json.IDCARD, idcard);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getPickRecordDetail(String orderNo) {
        String url = UrlUtil.GET_PICK_RECORD_DETAIL;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.ORDERNO, orderNo);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String cancleExchangeOrder(String exchangeNo) {
        String url = UrlUtil.CANCLE_EXCHANGE_ORDER;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.ORDERNO, exchangeNo);
        String jsonStr = mNetUtil.executeDelete(url, map);
        return jsonStr;
    }

    public String cancleDepositOrder(String orderNo) {
        String url = UrlUtil.CANCLE_DEPOSIT_ORDER;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.ORDERNO, orderNo);
        String jsonStr = mNetUtil.executeDelete(url, map);
        return jsonStr;
    }

    public String checkChangeTradingPwdInfo(String code, String idNum) {
        String url = UrlUtil.CHECK_CHANGE_TRAGING_PWD_INFO;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.CODE, code);
        map.put(Json.IDCARD, idNum);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String submitBalancePayInfo(String password, String amount, String orderNo) {
        String url = UrlUtil.SUBMIT_BALANCE_PAY_INFO;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.TRADINGPASSWORD, password);
        map.put(Json.BALANCEPAY, amount);
        map.put(Json.ORDERNO, orderNo);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }

    public String getDepositRecordDetail(String orderNo) {
        String url = UrlUtil.GET_DEPOSIT_RECORD_DETAIL;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.ORDERNO, orderNo);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String getExchangeRecordDetail(String exchangeNo) {
        String url = UrlUtil.GET_EXCHANGE_RECORD_DETAIL;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.ORDERNO, exchangeNo);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String checkVersion(String name, int versionCode, String versionName) {
        String url = UrlUtil.CHECK_VERSION;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(Json.NAME, name);
        map.put(Json.VERSIONNUMBER, versionCode + "");
        map.put(Json.VERSIONNAME, versionName);
        String jsonStr = mNetUtil.executePost(url, map);
        return jsonStr;
    }


    public String getUnReadMsg() {
        String url = UrlUtil.GET_UNREAD_MSG;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String getDiscoverNews(int type, String pageNum) {
        String url = UrlUtil.GET_DISCOVER_NEWS;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.OFFSET, pageNum);
        map.put(Json.COUNT, 20);
        if (type == 1) {
            map.put(Json.NEWSTYPE, 5);
        } else if (type == 2) {
            map.put(Json.NEWSTYPE, 6);
        } else if (type == 3) {
            map.put(Json.NEWSTYPE, 11);
        }
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String checkIsBindWechat() {
        String url = UrlUtil.CHECK_IS_BIND_WECHAT;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }

    public String bindWechat(String weChatCode) {
        String url = UrlUtil.CHECK_IS_BIND_WECHAT;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.WECHATCODE, weChatCode);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String wechatAuth(String weChatCode, String clientId, String imei, String blackBox, String channelId) {
        String url = UrlUtil.WECHAT_AUTH;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.WECHATCODE, weChatCode);
        map.put(Json.CLIENTID, clientId);
        map.put(Json.IMEI, imei);
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.CHANNELID, channelId);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String wechatLogin(String weChatCode, String userName, String clientId, String imei, String code, String blackBox, String channelId) {
        String url = UrlUtil.WECHAT_LOGIN;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.WECHATCODE, weChatCode);
        map.put(Json.USERNAME, userName);
        map.put(Json.CLIENTID, clientId);
        map.put(Json.IMEI, imei);
        map.put(Json.CODE, code);
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.CHANNELID, channelId);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String wechatRegister(String weChatCode, String userName, String password, String clientId, String imei, String blackBox, String channelId) {
        String url = UrlUtil.WECHAT_REGISTER;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(Json.WECHATCODE, weChatCode);
        map.put(Json.USERNAME, userName);
        map.put(Json.PASSWORD, password);
        map.put(Json.CLIENTID, clientId);
        map.put(Json.IMEI, imei);
        map.put(Json.BLACKBOX, blackBox);
        map.put(Json.CHANNELID, channelId);
        String jsonStr = mNetUtil.executeGet(url, map);
        return jsonStr;
    }

    public String getSupportBankList() {
        String url = UrlUtil.GET_SUPPORT_BANK_LIST;
        String jsonStr = mNetUtil.executeGet(url, null);
        return jsonStr;
    }
}
